#ifndef SYSCALLDISPATCHER_H
#define SYSCALLDISPATCHER_H

#include <InterruptServiceRoutine.h>

#define SYSCALL_FORK            1
#define SYSCALL_EXECVE          17
#define SYSCALL_EXIT            2
#define SYSCALL_YIELD           3
#define SYSCALL_YIELDTO         4
#define SYSCALL_NULL            5
#define SYSCALL_REQUEST         6
#define SYSCALL_MORERPC         7
#define SYSCALL_CREATERESOURCE  8
#define SYSCALL_ADDFUNC0        9
#define SYSCALL_ADDFUNC1        10
#define SYSCALL_ADDFUNC2        11
#define SYSCALL_ADDFUNC3        12
#define SYSCALL_ADDFUNC4        13
#define SYSCALL_ADDFUNC5        14
#define SYSCALL_DESTROYRESOURCE 15
#define SYSCALL_UFREE           16

s32int syscall(u32int id);
s32int syscall1(u32int id, s32int val);
s32int syscall2(u32int id, s32int val1, s32int val2);
s32int syscall3(u32int id, s32int val1, s32int val2, s32int val3);
s32int syscall4(u32int id, s32int val1, s32int val2, s32int val3, s32int val4);
s32int syscall5(u32int id, s32int val1, s32int val2, s32int val3, s32int val4, s32int val5);

/**
  Provides an interrupt service routine interface for dispatching 
  system calls.
**/
class SyscallDispatcher : public InterruptServiceRoutine
{
public:
  SyscallDispatcher();

  ~SyscallDispatcher();

  virtual void run(Registers *r);

};

#endif
